<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
    <!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
    <meta name="renderer" content="webkit">
    <!--国产浏览器高速模式-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="穷在闹市"/>
    <!-- 作者 -->
    <meta name="revised" content="穷在闹市.v3, 2019/05/01"/>
    <!-- 定义页面的最新版本 -->
    <meta name="description" content="网站简介"/>
    <!-- 网站简介 -->
    <meta name="keywords" content="搜索关键字，以半角英文逗号隔开"/>
    <title>穷在闹市出品</title>

    <!-- 公共样式 开始 -->
    <link rel="stylesheet" type="text/css" href="../../css/base.css">
    <link rel="stylesheet" type="text/css" href="../../fonts/iconfont.css">
    <script type="text/javascript" src="../../framework/jquery-1.11.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../../layui/css/layui.css">
    <script type="text/javascript" src="../../layui/layui.js"></script>
    <script src="../../framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
    <!-- 公共样式 结束 -->


</head>

<body>
<div class="cBody">
    <form class="layui-form" action="">
        <div class="console">
            <div class="layui-form-item">
                <a class="layui-btn" onclick="addCustomList('customList')">新增</a>
            </div>
        </div>

        <table id="customList" class="layui-table">
            <thead>
            <tr>
                <th>分管名称</th>
                <th>所属区域</th>
                <th>负责人</th>
                <th>联系方式</th>
                <th>传真</th>
                <th>邮箱</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>龙九山</td>
                <td>无锡市</td>
                <td>龙九山</td>
                <td>18600001111</td>
                <td>028-6666666</td>
                <td>123456789@qq.com</td>
                <td>
                    <a class="layui-btn layui-btn-xs" onclick="delCustomList(this)">删除</a>
                </td>
            </tr>
            <tr>
                <td>龙九山</td>
                <td>无锡市</td>
                <td>龙九山</td>
                <td>18600001111</td>
                <td>028-6666666</td>
                <td>123456789@qq.com</td>
                <td>
                    <a class="layui-btn layui-btn-xs" onclick="delCustomList(this)">删除</a>
                </td>
            </tr>

            </tbody>
        </table>
    </form>
</div>
<script>
    //根据2018.03.01日 张家港客户需求改版的要求，在新的后台框架中提供以下功能
    //此功能只适用与提前加载后，进行搜索；

    //新增
    function addCustomList(id) {
        var str = '<tr>' +
            '<td>' +
            '<select class="newSelectSearch" name="modules" lay-verify="required" lay-search="" lay-filter="selectFilter">' +
            '<option value="">直接选择或搜索选择</option>' +
            '</select>' +
            '</td>' +
            '<td>' +
            '<input type="tel" name="phone" lay-verify="required" autocomplete="off" class="layui-input">' +
            '</td>' +
            '<td>' +
            '<input type="tel" name="phone" lay-verify="required" autocomplete="off" class="layui-input">' +
            '</td>' +
            '<td>' +
            '<input type="tel" name="phone" lay-verify="required" autocomplete="off" class="layui-input">' +
            '</td>' +
            '<td>' +
            '<input type="tel" name="phone" lay-verify="required" autocomplete="off" class="layui-input">' +
            '</td>' +
            '<td>' +
            '<input type="tel" name="phone" lay-verify="required" autocomplete="off" class="layui-input">' +
            '</td>' +
            '<td>' +
            '<a class="layui-btn layui-btn-xs" onclick="delCustomList(this)">删除</a>' +
            '</td>' +
            '</tr>';
        $("#" + id).append(str);

        layui.use(['form', 'laydate'], function () {
            var form = layui.form;
            form.render();
        });
        //重新初始化Iframe的高度
        cframeInit();
    }

    //删除
    function delCustomList(_this) {
        layui.use(['form', 'laydate'], function () {
            layer.confirm('确定要删除么？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                $(_this).parent().parent().remove();
                layer.msg('删除成功', {
                    icon: 1
                });
            }, function () {
                layer.msg('取消删除', {
                    time: 2000 //20s后自动关闭
                });
            });
        });
    }

</script>
</body>

</html>